home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
001-025
/
disk_020
/
random
/
poster
next >
Wrap
Text File
|
1992-05-06
|
2KB
|
43 lines
Article 1366 of net.micro.amiga:
Relay-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site unisoft.UUCP
Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site amiga.amiga.UUCP
Path: unisoft!lll-lcc!vecpyr!amd!amdcad!amdimage!prls!pyramid!amiga!steve
From: steve@amiga.UUCP (Steve B.)
Newsgroups: net.micro.amiga
Subject: Random numbers
Message-ID: <982@amiga.amiga.UUCP>
Date: 11 Apr 86 19:48:59 GMT
Date-Received: 12 Apr 86 16:20:41 GMT
Reply-To: steve@maryann.UUCP (Steve Beats)
Distribution: net
Organization: Commodore Business Machines, 1200 Wilson Drive, West Chester, PA 19380
Lines: 125
While browsing through net.micro.amiga the other day, I noticed a simple
random number routine someone had put in thier posting. This prompted me
to dig through my old 6502 sources for a random number routine I used to
use a lot. Here, I've converted it from it's old 40 bit format into a 64 bit
format. I figured you Amigalites out there may find a use for it. It
appears to have excellent distribution and is OODLES faster than the floating
point equivalents. I would really be interested if someone who knows all
about random numbers could test out this routine and let me know how good it
is. I know the old 40 bit version used to repeat once every 8,589,934,592
iterations, thats 272 years worth at one per second. I have reason to suspect
that a 64 bit version would be better than this.
Note: each routine has two entry points, one for assembler and one for C.
use the same name for both since the Lattice C compiler adds an '_'
to the front of any external references.
Just assemble this thing (assem rnd.asm -o rnd.obj) and then link
the object file into your C or assembler program.
Well, thats about all, have fun.
Steve Beats
Commodore Technology